<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
</head>
<body>
<div>
  <p id="status" style="display: none" th:text="${message.status}"></p>
  <p th:text="${message.content}"></p>
</div>
</body>
<script>
    window.onload= myfun;
        function myfun(){
        var _status=$("#status").text()
         if(_status==400){
             setTimeout(function () {
                 window.location.href='/'
             },3000)
         }
    }
</script>
</html>